package com.colin.springbootsource.service;

import com.colin.springbootsource.domain.TbEmployee;
import com.colin.springbootsource.repository.TbEmployeeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * @author: Colin
 * 2019/12/21 14:54
 * @desc todo
 * @email zhaod@oceansoft.com.cn
 */
@Service
public class DemoService {
    @Autowired
    private TbEmployeeMapper tbEmployeeMapper;
    public TbEmployee getTbEmployeeById(int id){
        return Optional.ofNullable(tbEmployeeMapper.selectByPrimaryKey(id)).orElse(null);
    }
}
